import request from '@/utils/request';
import { getPageSize } from '@/utils/common';

export async function repairList(params) {
  params.pageSize = params.pageSize || getPageSize();
  return request(`/server/api/tms/tms-repair/selectList`, {
    method: 'POST',
    body: params,
  });
}

export async function repairDetail(params) {
  return request(`/server/api/tms/tms-repair/viewDetails`, {
    method: 'POST',
    body: params,
  });
}

export async function repairAdd(params) {
  return request(
    `/server/api/tms/tms-repair/insertRepair`,
    {
      method: 'POST',
      body: params,
    },
    true
  );
}

export async function repairEdit(params) {
  return request(
    `/server/api/tms/tms-repair/updateRepair`,
    {
      method: 'POST',
      body: params,
    },
    true
  );
}

export async function repairInfoAdd(params) {
  return request(
    `/server/api/tms/tms-repair-detail/insertRepairDetail`,
    {
      method: 'POST',
      body: params,
    },
    true
  );
}

export async function repairInfoEdit(params) {
  return request(
    `/server/api/tms/tms-repair-detail/updateRepairDetail`,
    {
      method: 'POST',
      body: params,
    },
    true
  );
}

export async function repairInfoList(params) {
  return request(`/server/api/tms/tms-repair-detail/selectList`, {
    method: 'POST',
    body: params,
  });
}

export async function repairInfoDetail(params) {
  return request(`/server/api/tms/tms-repair-detail/viewDetails`, {
    method: 'POST',
    body: params,
  });
}

export async function carList(params) {
  return request(`/server/api/tms/tms-repair/selectVehicle`, {
    method: 'POST',
    body: params,
  });
}
